*{
    margin: 0;
    padding: 0;
}
body{
    display: flex;
    /* 内容水平居中 */
    justify-content: center;
    /* 内容垂直居中 */
    align-items: center;
    height: 100vh;
}
ul{
    display: flex;
}
ul li{
    position: relative;
    list-style: none;
    width: 150px;
    height: 50px;
    cursor: pointer;
    /* 让子元素保留其3d位置 */
    transform-style: preserve-3d;
    transition: all .8s;
}
ul li:hover{
    transform: rotateX(90deg);
}
ul li:hover div.first-child{
    background-color: #51938f;
    background-size: 5px 5px;
    background-position: 30px 30px;
    background-image: linear-gradient(
        45deg,
        #478480 25%,
        rgba(0,0,0,0)25%
        rgba(0,0,0,0)75%
        #478480 75%,
		#478480
    );
}
ul li div{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 50px;
    font-size: 20px;
    font-weight: 700;
    color: red;
}
ul li div:first-child{
    background-color: #ddda16;
    transform: translateZ(25px);
}
ul li div:last-child{
    background-color: #51938f;
    background-size: 5px 5px;
    background-position: 30px 30px;
    background-image: linear-gradient(
        45deg,
        #478480 25%,
        rgba(0,0,0,0)25%
        rgba(0,0,0,0)75%
        #478480 75%,
		#478480
    );
    /* 把第二个往上以25px，并且沿着x轴旋转 */
    transform: translateY(25px) rotateX(-90deg);
}